package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UDataStandardMapper;
import com.ruoyi.system.domain.UDataStandard;
import com.ruoyi.system.service.IUDataStandardService;
import com.ruoyi.common.core.text.Convert;

/**
 * 标准台账Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-10
 */
@Service
public class UDataStandardServiceImpl implements IUDataStandardService 
{
    @Autowired
    private UDataStandardMapper uDataStandardMapper;

    /**
     * 查询标准台账
     * 
     * @param id 标准台账主键
     * @return 标准台账
     */
    @Override
    public UDataStandard selectUDataStandardById(Long id)
    {
        return uDataStandardMapper.selectUDataStandardById(id);
    }

    /**
     * 查询标准台账列表
     * 
     * @param uDataStandard 标准台账
     * @return 标准台账
     */
    @Override
    public List<UDataStandard> selectUDataStandardList(UDataStandard uDataStandard)
    {
        return uDataStandardMapper.selectUDataStandardList(uDataStandard);
    }

    /**
     * 新增标准台账
     * 
     * @param uDataStandard 标准台账
     * @return 结果
     */
    @Override
    public int insertUDataStandard(UDataStandard uDataStandard)
    {
        uDataStandard.setCreateTime(DateUtils.getNowDate());
        return uDataStandardMapper.insertUDataStandard(uDataStandard);
    }

    /**
     * 修改标准台账
     * 
     * @param uDataStandard 标准台账
     * @return 结果
     */
    @Override
    public int updateUDataStandard(UDataStandard uDataStandard)
    {
        uDataStandard.setUpdateTime(DateUtils.getNowDate());
        return uDataStandardMapper.updateUDataStandard(uDataStandard);
    }

    /**
     * 批量删除标准台账
     * 
     * @param ids 需要删除的标准台账主键
     * @return 结果
     */
    @Override
    public int deleteUDataStandardByIds(String ids)
    {
        return uDataStandardMapper.deleteUDataStandardByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除标准台账信息
     * 
     * @param id 标准台账主键
     * @return 结果
     */
    @Override
    public int deleteUDataStandardById(Long id)
    {
        return uDataStandardMapper.deleteUDataStandardById(id);
    }

    @Override
    public int updateUDataStandardFilePath(Long id, String filePath) {
        return uDataStandardMapper.updateUDataStandardFilePath(id, filePath);
    }
}
